package com.itheima.service.impl;

import com.itheima.dao.CheckgroupDao;
import com.itheima.dao.SetmealDao;
import com.itheima.service.CheckgroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class CheckgroupServiceImpl implements CheckgroupService {
    @Autowired
    CheckgroupDao checkgroupDao;
    @Autowired
    SetmealDao setmealDao;
    @Override
    public Boolean saveDelete(Integer id) {
        if (setmealDao.selectByGroupId(id)!=0) {
            return false;
        }
        checkgroupDao.delete(id);
        return true;
    }
}
